from django.db import models


class resource(models.Model):
    # resourceID = models.AutoField(primary_key=True)
    userID = models.IntegerField()
    datetime = models.DateTimeField()
    sectionID = models.CharField(max_length=255)
    title = models.CharField(max_length=255)
    downloads = models.IntegerField()
    # resourcepath = models.IntegerField()
    # likes = models.FloatField()
    # views = models.FloatField()
    # content = models.TextField()


# class resourcereview(models.Model):
#     resourcereviewID = models.IntegerField()
#     resourceID = models.IntegerField()
#     userID = models.IntegerField()
#     content = models.CharField(max_length=255)
#     likes = models.FloatField()


class comment(models.Model):
    userID = models.IntegerField()
    title = models.CharField(max_length=255)
    # content = models.CharField(max_length=255)
    datetime = models.DateTimeField()
    likes = models.FloatField(default=0)
    # views = models.FloatField()
    sectionID = models.IntegerField()


# class review(models.Model):
#     reviewID = models.IntegerField()
#     commentID = models.IntegerField()
#     userID = models.IntegerField()
#     datetime = models.DateTimeField()
#     reply = models.CharField(max_length=255)
#     likes = models.FloatField()


# class collection(models.Model):
#     userID = models.IntegerField()
#     resourceID = models.IntegerField()


class history(models.Model):
    userID = models.IntegerField()
    resourceID = models.IntegerField()
    datetime = models.DateTimeField()


class user(models.Model):
    userID = models.AutoField(primary_key=True)
    studentID = models.IntegerField(default='000')
    password = models.CharField(max_length=255)
    username = models.CharField(default='', max_length=255)
